package com.命令模式;

import com.命令模式.命令.BuyStockOrder;
import com.命令模式.命令.SellStockOrder;

/**
 * @author: 
 * @Date: 2022/8/26
 * @Description:
 */
public class CommandPatternDemo {
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStockOrder buyStockOrder = new BuyStockOrder(abcStock);
        SellStockOrder sellStockOrder = new SellStockOrder(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}
